import Vue from "vue"
import VueRouter from "vue-router"
import Layout from '@/layout/Main.vue'
Vue.use(VueRouter)

const routes = [{
        path: '/',
        redirect:'/publish',
        component: Layout,
        children: [{
                path: "/register",
                name: "register",
                component: ()=>import('@/views/Register.vue'),
                meta:{
                    title:'注册'
                }
            },
            {
                path: "/login",
                name: "login",
                component: ()=>import('@/views/Login.vue'),
                meta:{
                    title:'注册'
                }
            },
            {
                path: "/home",
                name: "home",
                component: ()=>import('@/views/Home.vue'),
                meta:{
                    title:'首页',
                    isTab:true
                }
            },
            {
                path: "/feed",
                name: "feed",
                component: ()=>import('@/views/Feed.vue'),
                meta:{
                    title:'热门',
                    isTab:true
                }
            },
            {
                path: "/publish",
                name: "publish",
                component: ()=>import('@/views/Publish.vue'),
                meta:{
                    title:'发布',
                    isTab:true
                }
            },
            {
                path: "/user",
                name: "user",
                component: ()=>import('@/views/User.vue'),
                meta:{
                    title:'我的',
                    isTab:true
                }
            },
            {
                path: "/article",
                name: "article",
                component: ()=>import('@/views/Article.vue'),
                meta:{
                    title:'文章',
                    isTab:true
                }
            },
            {
                path: "/detail/:id",
                name: "detail",
                component: ()=>import('@/views/Detail.vue'),
                meta:{
                    title:'文章详情'
                }
            },
            {
                path: "/trends",
                name: "trends",
                component: ()=>import('@/views/Trends.vue'),
                meta:{
                    title:'动态'
                }
            },
            {
                path: "/foucs",
                name: "foucs",
                component: ()=>import('@/views/Foucs.vue'),
                meta:{
                    title:'关注'
                }
            },
            {
                path: "/fans",
                name: "fans",
                component: ()=>import('@/views/Fans.vue'),
                meta:{
                    title:'粉丝'
                }
            },
            {
                path: "/collect",
                name: "collect",
                component: ()=>import('@/views/Collect.vue'),
                meta:{
                    title:'收藏'
                }
            },
            {
                path: "/follow",
                name: "follow",
                component: ()=>import('@/views/Follow.vue'),
                meta:{
                    title:'跟帖'
                }
            },
            {
                path: "/feedback",
                name: "feedback",
                component: ()=>import('@/views/Feedback.vue'),
                meta:{
                    title:'反馈'
                }
            },
            {
                path: "/search",
                name: "search",
                component: ()=>import('@/views/Search.vue'),
                meta:{
                    title:'搜索'
                }
            },
            {
                path: "/message",
                name: "message",
                component: ()=>import('@/views/Message.vue'),
                meta:{
                    title:'消息'
                }
            },
            {
                path: "/setting",
                name: "setting",
                component: ()=>import('@/views/Setting.vue'),
                meta:{
                    title:'设置'
                }
            },
        ]
    },

]

const router = new VueRouter({
    routes,
})

export default router